package com.hhd.day02


fun main(args: Array<String>) {
    /*遍历整形区间----------------------------*/
    val range = 1..100
    for (i in range) {
        println("遍历(for)区间= " + i)
    }


    for ((index, i) in range.withIndex()) {
        println("遍历(withIndex)区间= " + i)
    }

    range.forEach {
        println("遍历(forEach)区间= " + it)
    }

    range.forEachIndexed { index, i ->
        println("遍历(forEachIndexed)区间，下标= " + index + "；值= " + i)
    }

}